<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="created" content="2018-10-23T06:18:10.521000000">
    <meta name="changed" content="2021-05-21T06:18:42.262000000">
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Language" content="en">
    <title>
      D/T/J-K/S-R Flip-Flop
    </title>
    <link rel="stylesheet" type="text/css" href="../../style.css">
  </head>
  <body>
    <div class="maindiv">
      <h1>
        <img class="iconlibs" src="../../../../icons/6464/dflipflop.png" alt="#########" width="32" height="32">
		<img class="iconlibs" src="../../../../icons/6464/tflipflop.png"alt="#########" width="32" height="32">
		<img class="iconlibs" src="../../../../icons/6464/jkflipflop.png" alt="#########" width="32" height="32">
		<img class="iconlibs" src="../../../../icons/6464/srflipflop.png" alt="#########" width="32" height="32">
		<em> D/T/J-K/S-R Flip-Flop</em>
      </h1>
      <table>
        <tbody>
          <tr>
            <td>
              <strong>Library:</strong>
            </td>
            <td>
              <a href="index.html">Memory</a>
            </td>
          </tr>
          <tr>
            <td>
              <strong>Introduced:</strong>
            </td>
            <td>
              2.0 Beta 1
            </td>
          </tr>
          <tr>
            <td valign="top">
              <strong>Appearance:</strong>
            </td>
           <table>
                <tbody>
                  <tr>
                    <th></th>
                    <th width="50">
                      D
                    </th>
                    <th width="50">
                      T
                    </th>
                    <th width="50">
                      J-K
                    </th>
                    <th width="50">
                      S-R
                    </th>
                  </tr>
                  <tr>
                    <td valign="middle" align="left">
                      Logisim:
                    </td>
                    <td>
                      <img class="appearancelibs" src="../../../../img-libs/ldflipflops.png" alt="#########" width="64" height="64">
                    </td>
					 <td>
                      <img class="appearancelibs" src="../../../../img-libs/ltflipflops.png" alt="#########" width="64" height="64">
                    </td>
					 <td>
                      <img class="appearancelibs" src="../../../../img-libs/ljkflipflops.png" alt="#########" width="64" height="64">
                    </td>
					 <td>
                      <img class="appearancelibs" src="../../../../img-libs/lsrflipflops.png" alt="#########" width="64" height="64">
                    </td>
                  </tr>
                  <tr>
                    <td valign="middle" align="left">
                      Evolution:
                    </td>
					 <td>
                      <img class="appearancelibs" src="../../../../img-libs/hdflipflops.png" alt="#########" width="64" height="64">
                    </td>
					 <td>
                      <img class="appearancelibs" src="../../../../img-libs/htflipflops.png" alt="#########" width="64" height="64">
                    </td>
					 <td>
                      <img class="appearancelibs" src="../../../../img-libs/hjkflipflops.png" alt="#########" width="64" height="64">
                    </td>
					 <td>
                      <img class="appearancelibs" src="../../../../img-libs/hsrflipflops.png" alt="#########" width="64" height="64">
                    </td>
                  </tr>
                </tbody>
              </table>
            </td>
          </tr>
        </tbody>
      </table>
          </tr>
        </tbody>
      </table>
      <h2>
        Behavior
      </h2>
      <p>
        Each flip-flop stores a single bit of data, which is emitted through the <var>Q</var> output on the east side. Normally, the value can be controlled via the inputs to the west side. In particular, the value changes when the <strong>clock</strong> input, marked by a triangle on each flip-flop, rises from 0 to 1 (or otherwise as configured); on this rising edge, the value changes according to the table below.
      </p>
      <center>
        <table>
          <tbody>
            <tr>
              <th>
                D Flip-Flop
              </th>
              <th>
                T Flip-Flop
              </th>
              <th>
                J-K Flip-Flop
              </th>
              <th>
                S-R Flip-Flop
              </th>
            </tr>
            <tr>
              <td valign="top" align="center">
                <table>
                  <tbody>
                    <tr>
                      <th>
                        <var>D</var>
                      </th>
                      <th>
                        <var>Q</var>
                      </th>
                    </tr>
                    <tr>
                      <td align="center">
                        0
                      </td>
                      <td align="center">
                        0
                      </td>
                    </tr>
                    <tr>
                      <td align="center">
                        1
                      </td>
                      <td align="center">
                        1
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
              <td valign="top" align="center">
                <table>
                  <tbody>
                    <tr>
                      <th>
                        <var>T</var>
                      </th>
                      <th>
                        <var>Q</var>
                      </th>
                    </tr>
                    <tr>
                      <td align="center">
                        0
                      </td>
                      <td align="center">
                        <var>Q</var>
                      </td>
                    </tr>
                    <tr>
                      <td align="center">
                        1
                      </td>
                      <td align="center">
                        <var>Q</var>'
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
              <td valign="top" align="center">
                <table>
                  <tbody>
                    <tr>
                      <th>
                        <var>J</var>
                      </th>
                      <th>
                        <var>K</var>
                      </th>
                      <th>
                        <var>Q</var>
                      </th>
                    </tr>
                    <tr>
                      <td align="center">
                        0
                      </td>
                      <td align="center">
                        0
                      </td>
                      <td align="center">
                        <var>Q</var>
                      </td>
                    </tr>
                    <tr>
                      <td align="center">
                        0
                      </td>
                      <td align="center">
                        1
                      </td>
                      <td align="center">
                        0
                      </td>
                    </tr>
                    <tr>
                      <td align="center">
                        1
                      </td>
                      <td align="center">
                        0
                      </td>
                      <td align="center">
                        1
                      </td>
                    </tr>
                    <tr>
                      <td align="center">
                        1
                      </td>
                      <td align="center">
                        1
                      </td>
                      <td align="center">
                        <var>Q</var>'
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
              <td valign="top" align="center">
                <table>
                  <tbody>
                    <tr>
                      <th>
                        <var>S</var>
                      </th>
                      <th>
                        <var>R</var>
                      </th>
                      <th>
                        <var>Q</var>
                      </th>
                    </tr>
                    <tr>
                      <td align="center">
                        0
                      </td>
                      <td align="center">
                        0
                      </td>
                      <td align="center">
                        <var>Q</var>
                      </td>
                    </tr>
                    <tr>
                      <td align="center">
                        0
                      </td>
                      <td align="center">
                        1
                      </td>
                      <td align="center">
                        0
                      </td>
                    </tr>
                    <tr>
                      <td align="center">
                        1
                      </td>
                      <td align="center">
                        0
                      </td>
                      <td align="center">
                        1
                      </td>
                    </tr>
                    <tr>
                      <td align="center">
                        1
                      </td>
                      <td align="center">
                        1
                      </td>
                      <td align="center">
                        <em>??</em>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
            </tr>
          </tbody>
        </table>
      </center>
      <p>
        Another way of describing the different behavior of the flip-flops is in English text.
      </p>
      <ul>
        <li>
          <p>
            <strong>D Flip-Flop:</strong> When the clock triggers, the value remembered by the flip-flop becomes the value of the <var>D</var> input (<em>Data</em>) at that instant.
          </p>
        </li>
        <li>
          <p>
            <strong>T Flip-Flop:</strong> When the clock triggers, the value remembered by the flip-flop either toggles or remains the same depending on whether the <var>T</var> input (<em>Toggle</em>) is 1 or 0.
          </p>
        </li>
        <li>
          <p>
            <strong>J-K Flip-Flop:</strong> When the clock triggers, the value remembered by the flip-flop toggles if the <var>J</var> and <var>K</var> inputs are both 1 and the value remains the same if both are 0; if they are different, then the value becomes 1 if the <var>J</var> (<em>Jump</em>) input is 1 and 0 if the <var>K</var> (<em>Kill</em>) input is 1.
          </p>
        </li>
        <li>
          <p>
            <strong>S-R Flip-Flop:</strong> When the clock triggers, the value remembered by the flip-flop remains unchanged if <var>R</var> and <var>S</var> are both 0, becomes 0 if the <var>R</var> input (<em>Reset</em>) is 1, and becomes 1 if the <var>S</var> input (<em>Set</em>) is 1. The behavior in unspecified if both inputs are 1. (In Logisim, the value in the flip-flop remains unchanged.)
          </p>
        </li>
      </ul>
      <p>
        By default, the clock triggers on a rising edge — that is, when the clock input changes from 0 to 1. However, the Trigger attribute allows this to change to a falling edge (when the clock input changes from 1 to 0), a high level (for the duration that the clock input is 1), or a low level (for the duration that the clock input is 0). The level-trigger options are unavailable for the T and J-K flip-flops, because a flip-flop behaves unpredictably when told to toggle for an indeterminate amount of time.
      </p>
      <h2>
        Pins
      </h2>
      <dl>
        <dt>
          West edge, marked by triangle (input, bit width 1)
        </dt>
        <dd>
          Clock input: At the instant that this input value switches from 0 to 1 (the rising edge), the value will be updated according to the other inputs on the west edge. As long as this remains 0 or 1, the other inputs on the west edge have no effect.
        </dd>
        <dt>
          West edge, other labeled pin(s) (input(s), bit width 1)
        </dt>
        <dd>
          These inputs control how the flip-flop's value changes during the rising edge of the clock. Their exact behavior depends on the flip-flop; the above tables summarize their behavior.
        </dd>
        <dt>
          East edge, labeled <var>Q</var>, north end (output, bit width 1)
        </dt>
        <dd>
          Outputs the value currently stored by the flip-flop.
        </dd>
        <dt>
          East edge, south end (output, bit width 1)
        </dt>
        <dd>
          Outputs the complement of the value currently stored by the flip-flop.
        </dd>
        <dt>
          South edge, east end (input, bit width 1)
        </dt>
        <dd>
          Asynchronous reset: When 0 or undefined, this input has no effect. As long as it is 1, the flip-flop's value is pinned to 0. This occurs asynchronously - that is, without regard to the current clock input value. As long as this is 1, the other inputs have no effect.
        </dd>
        <dt>
          South edge, west end or Nort edge (input, bit width 1)
        </dt>
        <dd>
          Asynchronous set: When 0 or undefined, this input has no effect. When 1, the flip-flop's value is pinned to 1. This occurs asynchronously - that is, without regard to the current clock input value. As long as this input is 1, the other inputs have no effect, except for the asynchronous reset input, which has priority.
        </dd>
      </dl>
      <h2>
        Attributes
      </h2>
      <dl>
        <dt>
          Trigger
        </dt>
        <dd>
          Configures how the clock input is interpreted. The value <q>rising edge</q> indicates that the flip-flop should update its value at the instant when the clock rises from 0 to 1. The <q>falling edge</q> value indicates that it should update at the instant the clock falls from 1 to 0. The <q>high level</q> value indicates that the flip-flop should update continuously whenever the clock input is 1. And the <q>low level</q> value indicates that it should update continuously when the clock input is 0. Note that the latter two options are unavailable for T and J-K flip-flops.
        </dd>
        <dt>
          Label
        </dt>
        <dd>
          The text within the label associated with the flip-flop.
        </dd>
        <dt>
          Label Font
        </dt>
        <dd>
          The font with which to render the label.
        </dd>
		 <dt>
          Appaerance
        </dt>
        <dd>
          Classic Logisim : Presents flipflops as the legacy of logisim
		  Logisim-HolyCross / Logsim-Evolutions : New presentation of flipflops in the IEC way
        </dd>
      </dl>
      <h2>
        Poke Tool Behavior
      </h2>
      <p>
        Clicking a flip-flop using the Poke Tool toggles the bit stored in the flip-flop, unless the asynchronous set/reset inputs currently pin the flip-flop's value.
      </p>
      <h2>
        Text Tool Behavior
      </h2>
      <p>
        Allows the label associated with the component to be edited.
      </p>
      <p>
        <a href="../index.html">Back to <em>Library Reference</em></a>
      </p>
    </div>
  </body>
</html>
